#pragma once

namespace LSH
{
namespace GUI
{

//------------------------------------------------------------------------
class Point 
{
public:
    Point(void);
    Point(int x, int y);
    ~Point(void);
public:
    bool operator == (Point& other) const { return (x == other.x && y == other.y); }
    bool operator != (Point& other) const { return !(x == other.x && y == other.y); }
public:
    int x;
    int y;
};

//------------------------------------------------------------------------
class Size
{
public:
    Size(void);
    Size(unsigned x, unsigned y);
    ~Size(void);
public:
    bool operator == (const Size& other) const { return (x == other.x && y == other.y); }
    bool operator != (const Size& other) const { return !(x == other.x && y == other.y); }
public:
    Size& operator = (const Size& other) { x = other.x; y = other.y ; return *this; }
public:
    unsigned int x;
    unsigned int y;
};

//------------------------------------------------------------------------
class Rect
{
public:
    Rect(void);
    Rect(const Point& position, const Size& size);
    ~Rect(void);
public:
    bool operator == (const Rect& other) const { return (_position == other.getPosition() && _size == other.getSize()); }
    bool operator != (const Rect& other) const { return !(_position == other.getPosition() && _size == other.getSize()); }
public:
    Rect operator = (const Rect& other) { _position = other.getPosition(); _size = other.getSize(); return *this; } 
    void setPosition(const Point& point) { _position = point; }
    void setSize(const Size& size) { _size = size; }
    inline Point getPosition() const { return _position; }
    inline Size getSize() const { return _size; }
    bool isEmpty() { return (_position.x == 0 && _position.y == 0 && _size.x == 0 && _size.y == 0); }
public:
    bool isPointInRect(const Point& point) const;
    Rect getIntersection(const Rect& rect) const;
    Rect getContain(const Rect& rect) const;
protected:
    Point _position;
    Size _size;
};




} // GUI
} // LSH
